home *** CD-ROM | disk | FTP | other *** search
/ World of Video / World of Video.iso / datafiles / gfx_formats / gif / colmap.txt next >
Text File  |  1995-02-13  |  4KB  |  69 lines

  1.     Usage of Color Maps in GIF, and Recommendations (V 2.0)
  2.  
  3.         by Larry Brennan, 73327,3452
  4.  
  5.     Since an update of the GIF87a is contemplated, and some recent msgs on 
  6. the Board have indicated misunderstandings of the significance of the
  7. Global Header information described as CR ( color resolution ) and Pixel,
  8. please indulge me in my attempt to clarify.  Then I'll recommend a slight 
  9. change in the Standard and several changes in the practices of encoding
  10. and decoding GIF messages.  The purpose is to increase the information
  11. content of the data, while reducing the redundant content of the message.
  12.  
  13.     The CR value represents the information value of the originator's
  14. selection of colors to represent the subject, as limited by the originator's
  15. machine and choice of mode.  The originator might have a choice field of,
  16. say, 64d (EGA), or 4Kd (Amiga), or 16Md (VGA), and that information is
  17. pertinent to the decoder's choices of data for use of the target machine.
  18. The Pixel information represents the maximum palette array available to
  19. the originator's machine or mode, also useful information as to the limitations
  20. of the encoded message.
  21.  
  22.     The 87a definition of Pixel usage unnecessarily requires a color map 
  23. content of the maximum number of available palette indices, whether they
  24. are used or not, and usage of all of the indices is actually not common
  25. in practice.  I heartily endorse the restriction of color map requirements
  26. to the actual number used by the originator, with a few usage caveats as
  27. described below.
  28.  
  29.     The suggested usage refinements suggested are almost all at the encoder
  30. end of the translation for transmission, so the extra time and effort called
  31. for is not as critical as at the decoder end, where speed is more valued.
  32. My first plea is for the elimination of redundant hue choices occupying
  33. multiple palette indexes ( very common ).  The encoder can
  34. easily do this, and the decode process is simplified.  The next step
  35. would be to substitute NULL (0,0,0 for R,G,B) hue values for any palette indexes
  36. not actually used.  Again a simple encoder process making the decoder's
  37. life easier ( see CNTGIF & GIFDMP for  methods).  Next, reassign all used hue
  38. codes into the lowest palette indexes and delete all NULL values (with two
  39. exceptions) from the color map.  The exceptions are palette index 0, reserved
  40. for a useable (black) NULL value which also serves as a start delimiter for the
  41. color map, and another NULL value as an end delimiter for the
  42. condensed map.  Note that the information content is the same as before the 
  43. encoding and reorganization.  Now, to increase the useful information content,
  44. arrange the non-zero hues into palette indexes in reverse order of actual
  45. employment in the particular frame.  The decoder can address the translation
  46. of the original color map to the target machine's color map in the priority of
  47. actual usage in this specific frame, with no cost in time and with no clutter
  48. of either redundant or unused definitions.  Note also that existant GIF files
  49. are still fully decodable without modification.
  50.  
  51.     It is my view that at this point the decoder should carry
  52. some of the load and eliminate any hue redundancies in the target's map
  53. after translation, and also reassign the useful hues to the lower palette
  54. indices.  I don't sense a value to ordering the hue assignments by usage
  55. prevalence, but it would make for a still cleaner end product.
  56.  
  57.     So my recommended changes are quite minimal by themselves, but |+^|result in a cleaner, neater, product which will be more easily upgrade
  58. for future needs and increase the useful information content of the product
  59. with little trouble or hassle now, and invisibly to the casual user.
  60.  
  61.     Thanks for the use of the Hall.  Larry Brennan.
  62.  
  63.     
  64.  
  65.    
  66.  
  67.  
  68.